{% extends "myapp/base.html" %}

{% block mainBlock %}
<center>
    <h3>浏览相册图片信息</h3>
    <table width="900" border="1px">
        <tr>
            <th>Id号</th>
            <th>操作</th>
            <th>标题</th>
            <th>图片</th>
            <th>时间</th>
        </tr>
        {% for pic in picList %}
            <tr>
                <td>{{ pic.id }}</td>
                <td>
                    <a href="{% url 'editPicture' pic.id %}">编辑</a>
                    <a href="Javascript:doDel('{% url 'deletePicture' pic.id %}');">删除</a>
                </td>
                <td>{{ pic.title }}</td>
                <td><img src={{ pic.s_pic_url }} alt="图片" /></td>
                <td>{{ pic.upload_date|date:'Y-m-d H:i:s' }}</td>
            </tr>
        {% endfor %}
    </table>
    分页 
    {% for pindex in plist %}
        {% if pIndex == pindex %}
            {{ pindex }}&nbsp;&nbsp;
        {% else %}
            <a href={% url 'index' pindex %}>{{pindex}}</a>&nbsp;&nbsp;
        {% endif %}
    {% endfor %}
</center>
{% endblock %}

{% block scriptBlock %}
function doDel(url){
    if(confirm("确定要删除吗？")){
        debugger
        window.location.pathname=url;
    }
}
{% endblock %}